﻿namespace Hyt.Web.Security
{
    public interface ISafeCodeProvider
    {
        /// <summary>
        /// 根据SESSIONID获取SafeCode
        /// </summary>
        /// <param name="sessionid">SESSIONID</param>
        /// <returns></returns>
        string GetSafeCode(string sessionid);

        /// <summary>
        /// 获取新验证码
        /// </summary>
        /// <param name="sessionid">SESSIONID</param>
        /// <returns></returns>
        string NewSafeCode(string sessionid);

        /// <summary>
        /// 清除验证码
        /// </summary>
        /// <param name="sessionid">SESSIONID</param>
        void ClearSafeCode(string sessionid);

        /// <summary>
        /// 验证
        /// </summary>
        /// <param name="sessionid">SESSIONID</param>
        /// <param name="safecode">验证码</param>
        /// <returns></returns>
        bool ValidSafeCode(string sessionid, string safecode);
    }
}
